package org.itcast.dynamicdatasource.service.impl;

import org.itcast.dynamicdatasource.annotation.DDS;
import org.itcast.dynamicdatasource.mapper.FriendDao;
import org.itcast.dynamicdatasource.pojo.Friend;
import org.itcast.dynamicdatasource.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FriendServiceImpl implements FriendService {
    @Autowired
    private FriendDao friendDao;
    @Override
    public List<Friend> findDatas() {
        return friendDao.findDatas();
    }

    @Override
    @DDS("slave")
    public List<Friend> findSlaveDatas() {
        return friendDao.findDatas();
    }
}
